package com.itheima.collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Consumer;

public class Demo04 {

    public static void main(String[] args) {
        Collection<String> list = new ArrayList<>();
        list.add("坤坤");
        list.add("签签");
        list.add("滔滔");
        list.add("小鹿鹿");
        list.forEach(s->System.out.println(s));
        list.forEach(new Consumer<String>() {
            @Override
            public void accept(String s) {
                System.out.println(s);
            }
        });

    }
}
